package com.biodiv.community.controller.ai;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/helloworld")
public class HelloworldController {

    @Autowired
    private ChatClient chatClient;

    @GetMapping("/simple/chat")
    public String simpleChat(String query) {
        return chatClient.prompt(query).call().content();
    }

}